<!doctype html>
<html lang="en">

	<head>
		<meta charset="utf-8"/>
		<title><?php echo CHtml::encode($this->pageTitle); ?></title>
		
		<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/assets/css/layout.css" type="text/css" media="screen" />
		<!--[if lt IE 9]>
		<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/assets/css/ie.css" type="text/css" media="screen" />
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
		<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl; ?>/assets/css/form.css" type="text/css" media="screen" />
	
	</head>

	<body>
		<header id="header">
			<hgroup>
				<h1 class="site_title">
					<?php echo CHtml::link(h(Yii::app()->name),array('/site/dashboard')); ?>
				</h1>
				<h2 class="section_title"><?php echo $this->subTitle;?></h2>
				<div class="btn_view_site">
					<a target="_blank" href="http://www.southern-sys.com">SS</a>
				</div>
			</hgroup>
		</header> <!-- end of header bar -->
		
		<section id="secondary_bar">
			<div class="user">
				<p><?php 
				
				$fullName = user()->getModel()->persona->persona_apellido. ', ' .  user()->getModel()->persona->persona_nombres;
				$fullName = (strlen($fullName) > 20) ? substr($fullName,0,17).'...' : $fullName;
				echo $fullName;//(<a href="#">3 Messages</a>)?></p>
				<!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
			</div>
			<?php if(isset($this->breadcrumbs) && count($this->breadcrumbs) > 0):?>
				<div class="breadcrumbs_container">
					<article class="breadcrumbs">
						<?php 
							$this->widget(
											'CBreadcrumbsI18N', 
											array(
													'links'=>$this->breadcrumbs,
													'separator'=>'<div class="breadcrumb_divider"></div>',
												)
										); 
						?>
					</article>
				</div>
			<?php endif?>
		</section><!-- end of secondary bar -->
		<aside id="sidebar" class="column">
		<?php 
			if(MarketingMenu::getMenu() != null)
			{?>
				<h3><?php echo t('Marketing','marketing_etiqueta')?></h3>
				<?php 
					$this->widget(
									'zii.widgets.CMenu',
									array(
											'items'=>MarketingMenu::getMenu(),
											'htmlOptions'=>array('class'=>'toggle')
									)
					); 
			}?>
		
			<?php 
			if(is_array(PersonaMenu::getMenu()))
			{?>
				<h3><?php echo t('Persona','persona_etiqueta') ?></h3>
				<?php 
				$this->widget(
								'zii.widgets.CMenu',
								array(
									'items'=>PersonaMenu::getMenu(),
									'htmlOptions'=>array('class'=>'toggle')
								)
				); 
				?>
			<?php 
			}?>
			<?php 
			if(is_array(RightMenu::getMenu()))
			{?>
				<h3><?php echo t('Permisos','right_etiqueta') ?></h3>
				<?php 
					$this->widget(
									'zii.widgets.CMenu',
									array(
										'items'=>RightMenu::getMenu(),
										'htmlOptions'=>array('class'=>'toggle')
									)
					); 
				?>
			<?php 
			}?>
			
			<?php 
			if(is_array(IngresoMenu::getMenu()))
			{?>
				<h3><?php echo t('Ingreso','carrera_etiqueta') ?></h3>
				<?php 
					$this->widget(
									'zii.widgets.CMenu',
									array(
										'items'=>IngresoMenu::getMenu(),
										'htmlOptions'=>array('class'=>'toggle')
									)
					); 
				?>
			<?php 
			}?>
			
			<?php 
			if(is_array(CarreraMenu::getMenu()))
			{?>
				<h3><?php echo t('Carrera','carrera_etiqueta') ?></h3>
				<?php 
					$this->widget(
									'zii.widgets.CMenu',
									array(
										'items'=>CarreraMenu::getMenu(),
										'htmlOptions'=>array('class'=>'toggle')
									)
					); 
				?>
			<?php 
			}?>
			
			<?php 
			if(is_array(ContableMenu::getMenu()))
			{?>
				<h3><?php echo t('Contable','contable_etiqueta') ?></h3>
				<?php 
					$this->widget(
									'zii.widgets.CMenu',
									array(
										'items'=>ContableMenu::getMenu(),
										'htmlOptions'=>array('class'=>'toggle')
									)
					); 
				?>
			<?php 
			}?>
			<?php 
			if(is_array(ParametriaMenu::getMenu()))
			{?>
				<h3><?php echo t('Parametrizacion','nucleo_etiqueta') ?></h3>
				<?php 
					$this->widget(
									'zii.widgets.CMenu',
									array(
										'items'=>ParametriaMenu::getMenu(),
										'htmlOptions'=>array('class'=>'toggle')
									)
					); 
				?>
			<?php 
			}?>
			
			<?php 
			if(is_array(InfraestructuraMenu::getMenu()))
			{?>
				<h3><?php echo t('Infraestructura','infraestructura_etiqueta')?></h3>
				<?php 
					$this->widget(
									'zii.widgets.CMenu',
									array(
										'items'=>InfraestructuraMenu::getMenu(),
										'htmlOptions'=>array('class'=>'toggle')
									)
					); 
				?>
			<?php 
			}?>
			
			<?php 
			if(is_array(UsuarioMenu::getMenu()))
			{?>
				<h3>Administrar</h3>
				<?php 
					$this->widget(
									'zii.widgets.CMenu',
									array(
										'items'=>UsuarioMenu::getMenu(),
										'htmlOptions'=>array('class'=>'toggle')
									)
					); 
				?>
			<?php 
			}?>
			
			
		
		
		<?php 
		/*
		<form class="quick_search">
			<input type="text" value="Quick Search" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;">
		</form>
		<hr/>
		<h3></h3>
		<ul class="toggle">
			<li class="icn_new_article"><a href="#">New Article</a></li>
			<li class="icn_edit_article"><a href="#">Edit Articles</a></li>
			<li class="icn_categories"><a href="#">Categories</a></li>
			<li class="icn_tags"><a href="#">Tags</a></li>
		</ul>
		<h3>Users</h3>
		<ul class="toggle">
			<li class="icn_add_user"><a href="#">Add New User</a></li>
			<li class="icn_view_users"><a href="#">View Users</a></li>
			<li class="icn_profile"><a href="#">Your Profile</a></li>
		</ul>
		<h3>Media</h3>
		<ul class="toggle">
			<li class="icn_folder"><a href="#">File Manager</a></li>
			<li class="icn_photo"><a href="#">Gallery</a></li>
			<li class="icn_audio"><a href="#">Audio</a></li>
			<li class="icn_video"><a href="#">Video</a></li>
		</ul>
		<h3>Admin</h3>
		<ul class="toggle">
			<li class="icn_settings"><a href="#">Options</a></li>
			<li class="icn_security"><a href="#">Security</a></li>
			<li class="icn_jump_back"><a href="#">Logout</a></li>
		</ul>
		*/
		?>
		<footer>
			<hr />
			<p><strong>Copyright &copy; <?php echo date('Y');?> Southern Systems</strong></p>
			<p>Creado por <a target="_blank" href="http://www.southern-sys.com">Southern Systems</a></p>
		</footer>
	</aside><!-- end of sidebar -->
	
	<section id="main" class="column">
	<?php 
		foreach(Yii::app()->user->getFlashes() as $key => $message)
		{
    		echo '<h4 class="alert_' . $key . '">' . $message . "</h4>";
    	}
    	echo $content;
	?>
	</section>

</body>
<?php 
Yii::app()->clientScript->registerCoreScript('jquery',CClientScript::POS_END);
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/assets/js/hideshow.js',CClientScript::POS_END);
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/assets/js/jquery.tablesorter.min.js',CClientScript::POS_END);
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/assets/js/jquery.equalHeight.js',CClientScript::POS_END);
?>
	<script type="text/javascript">
		$(document).ready(function() 
	    { 
	      	  $(".tablesorter").tablesorter(); 
	   	} 
		);
		
		$(document).ready(function() {
	
			//When page loads...
			$(".tab_content").hide(); //Hide all content
			$("ul.tabs li:first").addClass("active").show(); //Activate first tab
			$(".tab_content:first").show(); //Show first tab content

			//On Click Event
			$("ul.tabs li").click(function() {
		
				$("ul.tabs li").removeClass("active"); //Remove any "active" class
				$(this).addClass("active"); //Add "active" class to selected tab
				$(".tab_content").hide(); //Hide all tab content
		
				var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
				$(activeTab).fadeIn(); //Fade in the active ID content
				return false;
			});
		
		});
		$(function(){
	        $('.column').equalHeight();
	    });
    </script>
</html>